package com.yanqu.road.entity.activity.stronghold;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.math.BigInteger;

@FieldTypeAnnotation(tableName = "t_c_activity_stronghold_eliminate_damage", desc = "据点战淘汰赛伤害记录")
public class CrossStrongholdEliminateDamage extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(select = true,update = true, desc = "当前轮数")
    private int round;
    @FieldTypeAnnotation(update = true, desc = "区服id")
    private long serverId;
    @FieldTypeAnnotation(desc = "联盟id")
    private String unionUid = "";
    @FieldTypeAnnotation(update = true, desc = "玩家id")
    private long userId;
    @FieldTypeAnnotation
    private UserBaseInfo userBaseInfo = new UserBaseInfo();
    @FieldTypeAnnotation(update = true, desc = "敌方区服id")
    private long enemyServerId;
    @FieldTypeAnnotation(update = true, desc = "敌方联盟id")
    private String enemyUnionUid = "";
    @FieldTypeAnnotation(desc = "伤害值")
    private BigInteger damage = BigInteger.ZERO;

    public int getActivityId() {
        return activityId;
    }

    public int getRound() {
        return round;
    }

    public long getServerId() {
        return serverId;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public long getUserId() {
        return userId;
    }

    public UserBaseInfo getUserBaseInfo() {
        return userBaseInfo;
    }

    public long getEnemyServerId() {
        return enemyServerId;
    }

    public String getEnemyUnionUid() {
        return enemyUnionUid;
    }

    public BigInteger getDamage() {
        return damage;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }
    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }

    }
    public void setServerId(long serverId) {
        if (this.serverId != serverId) {
            this.serverId = serverId;
            setOp(DataStatus.Update);
        }

    }
    public void setUnionUid(String unionUid) {
        if(null == unionUid){
            return;
        }
        if(!this.unionUid.equals(unionUid)) {
            this.unionUid = unionUid;
            setOp(DataStatus.Update);
        }
    } public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }
    public void setEnemyServerId(long enemyServerId) {
        if (this.enemyServerId != enemyServerId) {
            this.enemyServerId = enemyServerId;
            setOp(DataStatus.Update);
        }

    }
    public void setEnemyUnionUid(String enemyUnionUid) {
        if(null == enemyUnionUid){
            return;
        }
        if(!this.enemyUnionUid.equals(enemyUnionUid)) {
            this.enemyUnionUid = enemyUnionUid;
            setOp(DataStatus.Update);
        }
    }public void setDamage(BigInteger damage) {
        if(null == damage){
            return;
        }
        if(!this.damage.equals(damage)) {
            this.damage = damage;
            setOp(DataStatus.Update);
        }
    }

    public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
        this.userBaseInfo = userBaseInfo;
        setUpdateOption();
    }
}
